const { Topic } = require("../model/topics")

module.exports = async (req, res, next) => {
  const topics = await Topic.findById(req.params.id);
  if(!topics) return res.status(404).json({
    code: 404,
    msg: "话题不存在"
  })
  
  next();
}